package com.hyt.it.ogt.pj.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hyt.it.ogt.pj.model.entity.Project;
import com.hyt.it.ogt.pj.model.param.ProjectInfoParam;
import com.hyt.it.ogt.pj.model.vo.ProjectVo;
import com.hyt.it.ogt.pj.model.vo.TaskPageItemVo;
import com.hyt.model.PageParam;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 评卷项目表 服务类
 * </p>
 *
 * @author qiaozj
 * @since 2020-07-09
 */
public interface IProjectService extends IService<Project> {

    /**
     * 初始化评卷项目
     *
     * @param projectId
     * @param officeId
     * @throws Exception
     */
    void initProject(String projectId, String officeId) throws Exception;


    void initProjectForTask(String projectId, String officeId) throws Exception;

    /**
     * 当前登录人下的项目
     *
     * @param userId
     * @return
     */
    Project currentProject(String userId);

    /**
     * 查询评卷项目分页
     *
     * @param projectName
     * @param markStatus
     * @param current
     * @param size
     * @return
     */
    PageParam<ProjectVo> getPageProject(String projectName, String markStatus, long current, long size);

    /**
     * 创建老师评卷信息
     *
     * @param projectId
     * @param subjectId
     * @param userId
     */
    void createTeacherTaskInfo(String projectId, String subjectId, String userId);

    /**
     * 新增项目考生
     *
     * @param id
     * @param userId
     * @throws Exception
     */
    void addProjectStudent(String id, String userId) throws Exception;


    Integer addProjectStudentForTask(String projectId, String userId) throws Exception;

    /**
     * 撤销考生评卷
     *
     * @param projectId     评卷任务id
     * @param admissionNums 考生准考证号
     */
    void repealCandidateMark(String projectId, String admissionNums) throws Exception;

    /**
     * 分页
     *
     * @param pageParam
     * @param projectName
     * @param markStatus
     * @param officeId
     * @return
     */
    Page<ProjectVo> page(Page<ProjectVo> pageParam, String projectName, String markStatus, String officeId);

    /**
     * 更新评卷项目信息
     *
     * @param projectInfoParam 评卷项目信息参数对象
     */
    void updateProjectInfo(ProjectInfoParam projectInfoParam) throws Exception;

    /**
     * 项目数据导出
     *
     * @param projectId
     * @param officeId
     * @param deptId
     * @throws Exception
     */
    String projectDataDownload(String projectId, String officeId, String userId, String deptId) throws Exception;


    /**
     * 大考版项目数据导出
     *
     * @param projectId
     * @param officeId
     * @param deptId
     * @throws Exception
     */
    String dkbProjectDataDownload(String projectId, String officeId, String userId, String deptId) throws Exception;


    /**
     * 下载客观题成绩
     *
     * @param projectId
     * @param deptId
     * @return
     * @throws Exception
     */
    String objectiveScoreDataDownload(String projectId, String officeId, String userId, String deptId, HttpServletResponse response) throws Exception;


    /**
     * 大考版下载客观题成绩
     *
     * @param projectId
     * @param deptId
     * @return
     * @throws Exception
     */
    String dkbObjectiveScoreDataDownload(String projectId, String officeId, String userId, String deptId, HttpServletResponse response) throws Exception;

    /***
     * 获取评卷项目的评卷状态
     * @param projectId
     * @param officeId
     * @return
     * @throws Exception
     */
    ProjectVo getProjectMarkStatusByProjectId(@Param("projectId") String projectId, @Param("officeId") String officeId) throws Exception;

    /**
     * 获取评卷列表
     *
     * @param projectName
     * @param examState
     * @return
     */
    IPage<ProjectVo> getPageProjectList(PageParam<ProjectVo> pageParam, String currUserId, String projectName, String examState, String mobileMark);


    /**
     * 获取评非现考现评
     *
     * @param currUserId
     * @param projectId
     * @param subjectId
     * @param batchId
     * @param roomId
     * @return
     */
    ProjectVo getProjectInfo(String currUserId, String projectId, String subjectId, String batchId, String placeId, String roomId);


    /**
     * 获取老师考试下的学生列表数据
     *
     * @param pageParam
     * @param currUserId
     * @param projectId
     * @param subjectId
     * @param batchId
     * @param placeId
     * @param roomId
     * @param name
     * @param examState
     * @return
     */
    IPage<TaskPageItemVo> getStudentInfoPage(PageParam<TaskPageItemVo> pageParam, String currUserId, String projectId, String subjectId, String batchId, String placeId, String roomId,
                                             String name, String examState, String absentState, String order, String sort);

    /**
     * 删除没有主观题的通过过来的数据
     *
     * @param projectId
     */
    void deleteNotSubjectiveSubject(String projectId);

    /**
     * 通过任务ID获取项目列表
     *
     * @param timeId
     * @return
     */
    List<Project> listByTaskId(String timeId);

    /**
     * 删除评卷任务
     *
     * @param projectId
     */
    void deleteProject(String projectId);
}
